//
//  CTCResponderCell.m
//  ConsultantVersion
//
//  Created by 李小龙 on 2017/3/25.
//  Copyright © 2017年 jieshuibao. All rights reserved.
//

#import "CTCResponderCell.h"
@interface CTCResponderCell()
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UIButton *responderBtn;

@end
@implementation CTCResponderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setQuestionModel:(CTCQuestionModel *)questionModel
{
    _questionModel = questionModel;
    self.contentLabel.text = questionModel.content;
    self.dateLabel.text = [NSDate stringFromTimestamp:questionModel.date];
    
    if ([questionModel.status integerValue] == 0) {
        [self.responderBtn setBackgroundImage:[UIImage imageNamed:@"qiang"] forState:UIControlStateNormal];
    }
    else if ([questionModel.status integerValue] == 1) {
        [self.responderBtn setBackgroundImage:[UIImage imageNamed:@"qiang副本"] forState:UIControlStateNormal];
    }
}


- (IBAction)responderBtnClick:(UIButton *)sender {
    if (self.responderBtnBlock) {
        self.responderBtnBlock(self.questionModel);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
